home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga Format CD 42
/
Amiga Format AFCD42 (Issue 126, Aug 1999).iso
/
-serious-
/
programming
/
arexx
/
rxcmanager
/
examples
/
e2yam.rexx
< prev
next >
Wrap
OS/2 REXX Batch file
|
1999-05-25
|
1KB
|
82 lines
/*
Author: Alfonso Ranieri <alfier@iol.it>
Desription: export to Yam Addresses list
Template: KEY,USER/K
Tipical usage: rx e2yam >file
*/
call addlib("rmh.library",0,-30) then exit
call addlib("rxcmanager.library",0,-30) then exit
if ~open("STDERR","CONSOLE:","W") then stderr="STDOUT"
prg=programname("NOEXT")
if ~RMH_ReadArgs("KEY,USER/K") then do
call PrintFault(IoErr(),prg)
exit
end
if parm.0.flag then k = "#?"parm.0.value"#?"
else k = "#?"
if parm.1.flag then
call CMUserData(parm.1.value)
patt.Name = k
patt.Surname = k
patt.Email = k
patt.Alias = k
num = CMFind("USER GROUPS","USER","PATT")
if num=1 then call info "No user entry found"
else call info "Found" num "user(s)"
say 'YAB3 - YAM Addressbook'
g=""
p=""
ng=0
do i=0 to num-1
if user.i.Group~=g then do
if g~="" then do
if user.i.Group~=g & user.i.parents="" then do
call endG
end
end
say "@GROUP" user.i.Group
say
ng=ng+1
g=user.i.Group
end
if ~user.i.EmptyGroup then do
say '@USER' user.i.Alias
say user.i.Email
say user.i.Name user.i.LastName
say
say user.i.Phone
say user.i.Address
say user.i.ZIP
say user.i.Country
say
say
say
say user.i.WWW
say '@ENDUSER'
end
end
call endG
exit
info: procedure expose stderr prg
parse arg msg
call WriteLN(stderr,prg":" msg)
return
endG: procedure expose ng
do j=0 to ng-1
say "@ENDGROUP"
end
ng=0
return